package leetcode.code1899;


import leetcode.IDebug;

public class Solution implements IDebug {
	public boolean mergeTriplets(int[][] triplets, int[] target) {
		int ok = 0b111;
		int x = target[0], y = target[1], z = target[2];
		int ans = 0;
		for (int i = 0; i < triplets.length; i++) {
			int[] t = triplets[i];
			int t1 = t[0], t2 = t[1], t3 = t[2];
			int cur = 0;
			if (t1 > x || t2 > y || t3 > z) {
				continue;
			}
			if (t1 == x) {
				cur |= 0b1;
			}
			if (t2 == y) {
				cur |= 0b10;
			}
			if (t3 == z) {
				cur |= 0b100;
			}
			ans |= cur;
		}
		return ans == ok;
	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug1() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug1();
		so.debug2();
		so.debug3();
		so.debug4();

	}

}
